import React, { FC } from "react";
import { Typography } from 'antd'
import { QuestionTitlePropsType, QuestionTitleDefaultProps } from "./interface";

const { Title } = Typography

const TitleComp: FC<QuestionTitlePropsType> = (props) => {
  const { text, level = 1, isCenter, disabled, onChange } = { ...QuestionTitleDefaultProps, ...props }
  const getFontSize = {
    1: 24, 2: 20, 3: 16, 4: 16, 5: 16
  }[level]
  return <Title level={level} style={{
    fontSize: getFontSize,
    textAlign: isCenter ? 'center' : 'start',
    marginBottom: 0
  }}>{text}</Title>
}

export default TitleComp